 

        <g:set var="entityName" value="${message(code: 'teacher.label', default: 'Teacher')}" />
            <div class="list">
                <table>
                    <thead>
                        <tr>

                            <g:sortableColumn property="NO" title="${message(code: 'teacher.NO.label', default: 'NO')}" />             
                        
                           <g:sortableColumn property="name" title="${message(code: 'teacher.name.label', default: 'Name')}" /> 

                            <th>任教学科</th>
                        
                             <th>任教班级</th>
                            
                            <th>工作量（课时）</th>
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${schoolTeacherList}" status="i" var="teacherInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                            <td>${fieldValue(bean: teacherInstance, field: "NO")}</td>
                            <td>${fieldValue(bean: teacherInstance, field: "name")}</td>                        
                            <%
                                def teacherCourseClassesList = TeacherCourseClasses.findAllByTeacher(teacherInstance)
                            %>
                            

                            <td>
                            <%
                                teacherCourseClassesList.groupBy{
                                    it.course
                                }.each{
                                %>
                                ${it.key} 
                                <%}%>
                            </td>

                            <td>
                            ${groupTecherClasses}
                            <%
                                def groupTecherClasses = teacherCourseClassesList.groupBy{
                                    it.classes.id
                                }
                                groupTecherClasses.each{
                            %>
                                  ${it.value[0].classes}   
                             <%}%>
                             
                            </td>

                            <td>
                                <%def teacherPlanCount = Plan.countByTeacher(teacherInstance)
                                  
                                %>
                               ${teacherPlanCount > 0?teacherPlanCount:""}
                            </td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
            </div>